<script setup lang="ts">
const year = ref()
</script>

<template>
  <div class="news-detail">
    <article>
      <div class="time">2024-01-03</div>
      <div class="title">AI合作落地 致力提升客户服务体验
        致力提升客户服务体验致力提升客户服务体验
      </div>
      <div class="auth">
        <span>发布者：执象广告</span>
        <span>浏览量：8182</span>
      </div>
      <div class="article-content">
        <div v-for="i in 5">
          <h1>新闻内容</h1>
          <h2>新闻内容</h2>
        </div>

      </div>
    </article>
    <aside>
      <div class="title">新闻检索</div>
      <div class="sub-title">SEARCH</div>
      <div class="years">
        <el-date-picker
            type="year"
            v-model="year"
            :prefix-icon="shallowRef({
              render() {
                return h('p', '')
              },
            })"
            placeholder="所有年份"
        />
      </div>
      <div class="search-box">
        <input type="text" placeholder="输入关键词检索">
        <span class="search-btn"></span>
      </div>
      <div class="title">社交媒体</div>
      <div class="sub-title follow">FOLLOW VANKE</div>
      <div class="social-list">
        <div class="item" v-for="i in 3">
          <img class="icon" src="~/assets/icons/wx-green.png" alt="">
          <div class="qr-code-box">
            <img src="~/assets/images/news/qr-wx.jpg" alt="">
          </div>
        </div>
      </div>
    </aside>
  </div>
</template>

<style scoped lang="scss">
.news-detail {
  display: flex;
  position: relative;
  padding-left: 1.74rem;
  padding-top: 0.95rem;
  padding-bottom: 2rem;

  article {
    width: 12.94rem;

    .time {
      font-size: 0.3rem;
      font-weight: 400;
      line-height: 0.6rem;
    }

    .title {
      width: 12.4rem;
      font-size: 0.45rem;
      font-weight: 500;
      line-height: 0.6rem;
      margin-top: 0.18rem;
      margin-bottom: 0.3rem;
    }

    .auth {
      font-size: 0.23rem;
      font-weight: 500;
      color: #999999;
      line-height: 0.6rem;

      span {
        display: inline-block;
        margin-right: 0.3rem;
      }
    }

    .article-content {
      padding-top: 0.45rem;
    }
  }

  aside {
    position: sticky;
    margin-left: 0.91rem;
    top: 0.95rem;
    width: 6.75rem;
    height: 9.39rem;
    background: url(~/assets/images/news/detail-search-bg.png);
    background-size: 6.75rem 9.39rem;
    padding-top: 0.51rem;
    padding-left: 0.53rem;

    .title {
      font-size: 0.33rem;
      font-weight: 500;
    }

    .sub-title {
      font-size: 0.23rem;
      font-weight: bold;
      color: #8F8784;
      padding-left: 0.07rem;

      &.follow {
        color: #42A989;
        padding-left: 0;
      }
    }

    .years {
      width: 5.53rem;
      height: 0.98rem;
      background: #FFFFFF;
      border-radius: 0.06rem;
      display: flex;
      align-items: center;
      font-size: 0.2rem;
      margin-top: 0.44rem;
      margin-bottom: 0.21rem;

      :deep(.el-input) {
        width: 5rem;
      }
    }

    .search-box {
      width: 5.53rem;
      height: 0.98rem;
      background: #FFFFFF;
      border-radius: 0.06rem;
      display: flex;
      align-items: center;
      margin-bottom: 0.59rem;

      input {
        font-size: 0.2rem;
        width: 4.5rem;
        height: 0.7rem;
        outline: none;
        border: none;
        padding-left: 0.34rem;
        font-weight: 500;
        color: #7C7C85;
      }

      .search-btn {
        display: block;
        width: 0.33rem;
        height: 0.33rem;
        background: url(~/assets/icons/search.png) no-repeat;
        background-size: 0.33rem;
        cursor: pointer;
      }
    }
    .social-list{
      display: flex;
      margin-top: 0.21rem;
      .item{
        cursor: pointer;
        &:hover{
          .qr-code-box{
            height: 1.71rem;
            transition: 0.5s;
            opacity: 1;

            img{
              height: 1.45rem;
            }
          }
        }
        .icon{
          width: 0.55rem;
          height: 0.55rem;
          margin-right: 0.3rem;
        }
        .qr-code-box{
          position: absolute;
          transition: 0.5s;
          height: 0;
          overflow: hidden;
          margin-top: 0.14rem;
          background: url(~/assets/images/news/qr-bg.png) no-repeat;
          background-size: 1.61rem 1.71rem;
          width: 1.61rem;
          display: flex;
          align-items: center;
          justify-content: center;
          opacity: 0;
          img{
            transition: 0.5s;
            height: 0;
            margin-top: 0.1rem;
            width: 1.45rem;
          }
        }
      }
    }
  }
}
</style>

<style>
.el-input__wrapper {
  box-shadow: none;
  outline: none !important;

  .el-input__inner {
    font-size: 0.2rem;
    color: #7C7C85;

    &::-webkit-input-placeholder {
      color: #7C7C85;
    }
  }

  &:hover {
    box-shadow: none;
  }
}
</style>
